Video digitizer components may support one of three methods of selectively displaying video on the screen of a Macintosh computer. The three methods are key colors, alpha channels, and blend masks. For a complete description of these techniques for selectively displaying video, see "About Video Digitizer Components," which begins on About Video Digitizer Components .
Your application can determine whether a video digitizer component supports selective video display by examining the component's digitizer information structure (described on The Digitizer Information Structure ). Specifically, the vdigType field indicates the type of blending supported by the digitizer. Applications can use the VDGetDigitizerInfo function (described on VDGetDigitizerInfo ) to retrieve a component's digitizer information structure.
Some video digitizer components support the use of key colors as a mechanism for selectively displaying video on the screen of a Macintosh computer. When a key color is active, the digitizer component replaces all screen occurrences of that color with the appropriate portion of the source video. Video digitizer components that support key colors provide a number of functions to applications. Those functions are described in this section.
Your applications can use the VDSetKeyColor , VDAddKeyColor , and VDSetKeyColorRange functions to set one or more key colors for a video digitizer component. The VDGetKeyColor , VDGetNextKeyColor , and VDGetKeyColorRange functions allow your application to retrieve information about the currently active key colors.
Alpha channels and blend masks work similarly to one another. Digitizer components that support alpha channels use a portion of each pixel value to indicate the degree of video display for that pixel. Digitizer components that support blend masks use the mask to indicate the degree of video display for corresponding pixels.
Your applications can use the VDGetMaskandValue function to determine the appropriate mask value for a desired blend level. The VDSetMasterBlendLevel function allows applications to set a blend level that applies to the entire source video image. The VDGetMaskPixMap function allows applications to retrieve the pixel map that defines the blend mask.
The VDSetKeyColor function allows applications to set the key color.
All video digitizer components that support key colors must support this function.
pascal VideoDigitizerError VDSetKeyColor
(VideoDigitizerComponent ci,
long index);
Some video digitizer components support multiple key colors. The VDSetKeyColor function instructs such digitizer components to clear the key color list and insert a single entry for the specified color. Applications can then use the VDAddKeyColor function, described on VDAddKeyColor , to place additional colors into the key color list.
The VDGetKeyColor function allows your application to obtain the index value of the active key color.
All video digitizer components that support key colors must support this function.
pascal VideoDigitizerError VDGetKeyColor
(VideoDigitizerComponent ci,
long *index);
In cases where there are several key colors, the VDGetKeyColor function always returns the index of the first color in the list. Applications should then use the VDGetNextKeyColor function (described on VDGetNextKeyColor ) to retrieve the remaining colors in the list.
Some video digitizer components that support key colors may allow applications to set a range of key color values. The key color range is expressed as a range of RGB color values. The VDSetKeyColorRange function allows your application to define a key color range.
pascal VideoDigitizerError VDSetKeyColorRange
(VideoDigitizerComponent ci,
RGBColor *minRGB,
RGBColor *maxRGB);
If the digitizer component cannot accommodate all the colors that are defined in the specified range, it returns a result value of noMoreKeyColors .
Your application can obtain the current key color range by calling the VDGetKeyColorRange function, which is described on VDGetKeyColorRange .
Some video digitizer components can support more than one active key color. The VDAddKeyColor function allows applications to add a key color to a component's list of active key colors.
pascal VideoDigitizerError VDAddKeyColor
(VideoDigitizerComponent ci,
long *index);
If the digitizer component cannot accommodate any more key colors, it returns a result code of noMoreKeyColors .
To ensure that the key color list contains only the desired colors, your application should use the VDSetKeyColor function (described on VDSetKeyColor ) to set the first key color.
Some video digitizer components that support key colors may allow applications to set a range of key color values. The key color range is expressed as a range of RGB color values. The VDGetKeyColorRange function allows applications to obtain the currently defined key color range.
pascal VideoDigitizerError VDGetKeyColorRange
(VideoDigitizerComponent ci,
RGBColor *minRGB,
RGBColor *maxRGB);
Your application can set the color range by calling the VDSetKeyColorRange function, which is described on VDSetKeyColorRange .
The VDGetNextKeyColor function allows your application to obtain the index value of the active key colors in cases where the digitizer component supports multiple key colors. Your application can use the VDGetKeyColor function (described on VDGetKeyColor ) to retrieve the first key color in the list. Subsequently, your application can call the VDGetNextKeyColor function to retrieve the other colors in the key color list.
All video digitizer components that support multiple key colors must support this function.
pascal VideoDigitizerError VDGetNextKeyColor
(VideoDigitizerComponent ci,
long index);
The VDSetMasterBlendLevel function allows your application to set the blend level value for the input video signal. This value applies to the entire source video image.
pascal VideoDigitizerError VDSetMasterBlendLevel
(VideoDigitizerComponent ci,
unsigned short *blendLevel);
The VDGetMaskandValue function allows your application to obtain the appropriate alpha channel or blend mask value for a desired level of video blending. Your application specifies a desired level of video blend.
pascal VideoDigitizerError VDGetMaskandValue
(VideoDigitizerComponent ci,
unsigned short blendLevel,
long *mask, long *value);
The video digitizer returns the corresponding mask value. The application can then use this value to set the alpha channel or blend mask.
The information returned by the digitizer component differs based on the type of blending supported by the component. In all cases, however, the returned value of the value parameter contains the value for the desired blend level, and the returned value of the mask parameter indicates which bits in the value parameter are meaningful. Bits in the returned mask parameter value that are set to 1 correspond to meaningful bits in the returned value parameter value.
For example, if an application requests a 50 percent video blend level from a digitizer that supports 8-bit alpha channels, the digitizer component might return the following values:
The VDGetMaskPixMap function allows applications to retrieve the pixel map data for a component's blend mask. This function is supported only by digitizer components that support blend masks.
pascal VideoDigitizerError VDGetMaskPixMap
(VideoDigitizerComponent ci,
PixMapHandle maskPixMap);